package dao

import (
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"modulename/model/entity"
)

func GetUserById(id string) entity.User {
	user := entity.User{}
	db.Table("users").Where("name = ?", id).Find(&user)
	return user
}

func AddUser(user entity.User) {
	// 插入对象
	db.Create(&user)
}
